<?php
/**
 * Created by PhpStorm.
 * User: david
 * Date: 2018/5/28
 * Time: 11:14
 */

namespace app\controller;


use app\model\Project as ProjectModel;
use app\model\ProjectMenu as ProjectMenuModel;
use app\model\Xmdj as XmdjModel;
use app\model\XmdjImg as XmdjImgModel;
use app\model\Zcjy as ZcjyModel;
use app\model\Hotel as HotelModel;

class Project extends Base
{
    public function index()
    {
        $act = 4;
        $i = 'item4';
        $projects = ProjectModel::getProjects();
        return view('index', compact(['act', 'i', 'projects']));
    }

    public function detail()
    {
        $act = 4;
        $i = 'item3';
        $id = $this->request->param('id');
        $project = ProjectModel::get($id);
        return view('detail', compact(['act', 'i', 'project']));
    }

    public function project($pid)
    {
        $projects = ProjectModel::getProjects($pid);
        $menu = ProjectMenuModel::get($pid);
        return view('project', compact(['projects', 'menu']));
    }

    public function sydc()
    {
        $projects = ProjectModel::getProjects();
        return view('sydc', compact(['projects']));
    }

    public function sydcdetail($id)
    {
        $project = ProjectModel::get($id);
        return view('sydcdetail', compact(['project']));
    }

    public function xmdj()
    {
        $xmdj = XmdjModel::getItems();
        $active = 3;
        return view('xmdj', compact(['xmdj', 'active']));
    }

    public function xmdjdetail($id)
    {
        $xmdj = XmdjModel::get($id);
        $active = 3;
        return view('xmdjdetail', compact(['xmdj', 'active']));
    }

    public function zcjy()
    {
        $list = ZcjyModel::getItems();
        return view('zcjy', compact(['list']));
    }

    public function zcjydetail($id)
    {
        $zcjy = ZcjyModel::get($id);
        return view('zcjydetail', compact(['zcjy']));
    }

    public function hotel()
    {
        return view('hotel');
    }
}